/********************************************************
* 
* Copyright (C) 2015-2015, All rights reserved
* Designed by EjoinTech XP Development Team.
* 
* 
* File:         utl_sip_auth.h
* PACKAGE:      libeut
*   Header of:          utl_sip_auth.c
*   Date:               2015.09.18
*   Author:             PengJian
*   Version:            1.0
*
* Change
* 
*********************************************************/
    
#ifndef  __UTL_SIP_AUTH_H__
#define  __UTL_SIP_AUTH_H__

#ifdef __cplusplus
extern "C" {
#endif

/***************************************************************************
 * Calculate the sip authorization response
 *
 * @param alg:      the algrithm, can be "md5"(default) or "md5-sess"
 * @param username: the sip account
 * @param realm:    the sip domain
 * @param password: the password for the sip account
 * @param nonce:    the nonce generated by sip proxy or registar
 * @param nc:       the reference count of nonce in string
 * @param cnonce:   the client nonce value
 * @param qop:      the auth operation, can be NULL, "auth" and "auth-int"
 * @param method:   the sip request method, such as "REGISTER", "INVITE", ...
 * @param uri:      the sip request uri
 *
 * @param response: the calculated response
 */
void utl_sip_calc_resp(const char* alg, const char* username, const char* realm, const char* password,
                       const char* nonce, const char* nc, const char* cnonce,
                       const char* qop, const char* method, const char* uri, char response[33]);

#ifdef __cplusplus
}
#endif

#endif

